package interfazeak;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class Konfigurazioa extends JFrame{

	private JPanel contentPane;
	
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Konfigurazioa frame = new Konfigurazioa();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	public Konfigurazioa() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 748, 451);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setTitle("KONFIGURAZIOA");
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		
		JButton upelakbtn = new JButton("UPELAK");
		upelakbtn.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				
				Konfigurazioa.this.upelak();
				
			}
		});
		upelakbtn.setBounds(200, 100, 150, 30);
		contentPane.add(upelakbtn);
		

		JButton barietateakbtn = new JButton("BARIETATEAK");
		barietateakbtn.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
			
				Konfigurazioa.this.barietateak();
			}
		});
		barietateakbtn.setBounds(200, 200, 150, 30);
		contentPane.add(barietateakbtn);
		
		
		JButton  btnHasieraOrria= new JButton("HASIERA ORRIA");
		btnHasieraOrria.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
				Konfigurazioa.this.buelta();
			}
		}); 
		btnHasieraOrria.setBounds(500, 20, 157, 25);
		contentPane.add(btnHasieraOrria);
	}
	protected void barietateak() {
		
		JDialog dialog = new BarietateaKonf(Konfigurazioa.this, true);
		dialog.setVisible(true);
		this.dispose();
	}
	protected void upelak() {
		
		JDialog dialog = new Upela(Konfigurazioa.this, true);
		dialog.setVisible(true);
		this.dispose();
	}
	protected void buelta() {
		
		Hasiera h = new Hasiera();
		h.setVisible(true);
		this.dispose();
	}
}
